home *** CD-ROM | disk | FTP | other *** search
- #ifndef rectpie_H
- #define rectpie_H
-
- #ifndef shape_H
- #include "shape.h"
- #endif
-
-
- struct_(Rectangle) {
- /* private: */
- unsigned width, heighth;
- polymorphic();
- /* public: */
- inherit(Shape);
- };
-
- #define RT_ShapeThiS(thiS) baseThiS(thiS,Shape)
- polyBaseThiS_0_decl(RT,Shape,Rectangle);
- #define SH_RectangleThiS(thiS) \
- derivedThiS(thiS,Rectangle)
-
- vFt_decl(Rectangle,Shape);
-
- vf_decl(void,RT,SH,show,(Shape * thiS, int xxpose,
- int yxpose, unsigned scale));
- vf_decl(void,RT,SH,destruct,(Shape * thiS,
- unsigned nobj, int malloced));
-
- struct_initVFTs_decl(RT,(Rectangle * thiS,
- void * descendanT_0, vFT_0_decl(Shape)));
-
- #define RT_malloc(nobj) MALLOC(sizeof(Rectangle)*nobj)
- #define RT_free(thiS) FREE(thiS)
-
- struct_init_decl(Rectangle,RT,_,
- (Rectangle * thiS_0, unsigned nobj,
- unsigned width, unsigned heighth,
- unsigned x, unsigned y));
-
- struct_destruct_decl(Rectangle,RT);
-
- #define RT_init(thiS_0,nobj,width,heighth,x,y) \
- struct_init(RT,_,(thiS_0, \
- nobj,width,heighth,x,y))
- #define RT_init_default(thiS_0) \
- RT_init(thiS_0,1,(unsigned)getmaxx()/4, \
- (unsigned)getmaxy()/4,0,0)
- #define RT_new(nobj,width,heighth,x,y) \
- RT_init((Rectangle *)0,nobj,width,heighth,x,y)
- #define RT_new_default() \
- RT_init_default((Rectangle *)0)
- #define RT_destruct(thiS,nobj) \
- SH_destruct(RT_ShapeThiS(thiS),nobj)
- #define RT_delete(thiS_0,nobj) \
- SH_delete(RT_ShapeThiS(thiS_0),nobj)
-
- #define RT_getx(thiS) SH_getx(RT_ShapeThiS(thiS))
- #define RT_gety(thiS) SH_gety(RT_ShapeThiS(thiS))
- #define RT_show(thiS,xxpose,yxpose,scale) \
- SH_show(RT_ShapeThiS(thiS),xxpose,yxpose,scale)
- #define RT_show_default(thiS) RT_show(thiS,0,0,1)
-
-
-
- struct_(PieSlice) {
- /* private: */
- unsigned startAngle, endAngle;
- polymorphic();
- /* public: */
- inherit(Circle);
- };
-
- #define PS_CircleThiS(thiS) baseThiS(thiS,Circle)
- #define PS_ShapeThiS(thiS) \
- CR_ShapeThiS(PS_CircleThiS(thiS))
- polyBaseThiS_0_decl(PS,Shape,PieSlice);
- #define CR_PieSliceThiS(thiS) \
- derivedThiS(thiS,PieSlice)
- #define SH_PieSliceThiS(thiS) \
- CR_PieSliceThiS(SH_CircleThiS(thiS))
-
- vFt_decl(PieSlice,Shape);
-
- vf_decl(void,PS,SH,show,(Shape * thiS, int xxpose,
- int yxpose, unsigned scale));
- vf_decl(void,PS,SH,destruct,(Shape * thiS,
- unsigned nobj, int malloced));
-
- struct_initVFTs_decl(PS,(PieSlice * thiS,
- void * descendanT_0, vFT_0_decl(Shape)));
-
- #define PS_malloc(nobj) MALLOC(sizeof(PieSlice)*nobj)
- #define PS_free(thiS) FREE(thiS)
-
- struct_init_decl(PieSlice,PS,_,
- (PieSlice * thiS_0, unsigned nobj,
- unsigned startAngle,
- unsigned endAngle,
- unsigned radius,
- unsigned x, unsigned y));
-
- struct_destruct_decl(PieSlice,PS);
-
- #define PS_init(thiS_0,nobj,startAngle,endAngle, \
- radius,x,y) struct_init(PS,_,(thiS_0, \
- nobj,startAngle,endAngle,radius,x,y))
- #define PS_init_default(thiS_0) \
- PS_init(thiS_0,1,30,60, \
- (unsigned)getmaxy()/8,0,0)
- #define PS_new(nobj,startAngle,endAngle,radius,x,y) \
- PS_init((PieSlice *)0,nobj, \
- startAngle,endAngle,radius,x,y)
- #define PS_new_default() \
- PS_init_default((PieSlice *)0)
- #define PS_destruct(thiS,nobj) \
- CR_destruct(PS_CircleThiS(thiS),nobj)
- #define PS_delete(thiS_0,nobj) \
- CR_delete(PS_CircleThiS(thiS_0),nobj)
-
- #define PS_getx(thiS) CR_getx(PS_CircleThiS(thiS))
- #define PS_gety(thiS) CR_gety(PS_CircleThiS(thiS))
- #define PS_show(thiS,xxpose,yxpose,scale) \
- CR_show(PS_CircleThiS(thiS),xxpose,yxpose,scale)
- #define PS_show_default(thiS) PS_show(thiS,0,0,1)
-
-
- #endif
-